package cn.wolfcode.shop.cloud.pay;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 */
@Configuration
public class AlipayConfig {
    @Bean
    public AlipayClient alipayClient(AlipayProperties alipayProperties){
        return new DefaultAlipayClient(alipayProperties.getGatewayUrl(), alipayProperties.getApp_id(), alipayProperties.getMerchant_private_key(), "json", alipayProperties.getCharset(), alipayProperties.getAlipay_public_key(), alipayProperties.getSign_type());
    }
}
